import { defineNuxtConfig } from 'nuxt/config'
const autoprefixer = require('autoprefixer')
const pxtorem = require('postcss-pxtorem')
export default defineNuxtConfig({
    devtools: { enabled: true },
    typescript: { typeCheck: true },
    app: {
        head: {
            title: '文都网-中国教育考试培训网站-文都教育官网',
            htmlAttrs: {
                lang: 'zh-CN'
            },
            meta: [
                { charset: 'utf-8' },
                { name: 'viewport', content: 'width=device-width, initial-scale=1' },
                {
                    hid: 'keywords',
                    name: 'keyword',
                    content: '文都,文都考研,文都考研网,考研,医考,四六级,建造师考试,公考,教师资格考试,司法考试,考试培训,教育培训,辅导班'
                },
                {
                    hid: 'description',
                    name: 'description',
                    content:
                        '【文都网】是文都教育打造的中国教育考试培训网站，提供考研，医考，建造师考试，公考，教师资格，四六级，司法考试等7大类30多种考试的考前培训、备考资料、考试资讯、在线测评，直播课等服务。'
                }
            ],
            link: [
                { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
                {
                    rel: 'stylesheet',
                    href: 'https://at.alicdn.com/t/font_2605464_k4sgrjqq5n.css'
                }
            ],
            script: [
                {
                    src: '/_nuxt/util/flexiable.js',
                    type: 'text/javascript'
                }
            ]
        }
    },
    css: ['~/assets/css/mixins.less', '~/assets/css/normalize.less', 'element-plus/dist/index.css'],
    modules: ['nuxt-swiper', '@element-plus/nuxt', '@nuxtjs/tailwindcss'],
    vite: {
        css: {
            preprocessorOptions: {
                less: {
                    additionalData: '@import "~/assets/css/varibles.less";'
                }
            },
            postcss: {
                plugins: [
                    autoprefixer(),
                    pxtorem({
                        rootValue: 100,
                        exclude: /node_modules/i,
                        propList: ['*'],
                        // minPixelValue: 12, //px小于12的不会被转换
                        // 保留rem小数点多少位
                        unitPrecision: 5
                    })
                ]
            }
        }
    },
    plugins: [
        {
            src: 'util/flexiable.js',
            ssr: false
        }
    ]
})
